package tp.pr0;

public class FuncsMatematicas {
	public static int factorial(int n) {
		if (n < 0)
			return 0;
		
		int res = 1;
		for (int i = 1; i <=n; ++i) {
			res*=i;
			
		}
		
		return res;	
	}
	
	public static int combinatorio (int n, int m) {
		if (n < 0 || m < 0 || m>n)
			return 0;
		
		
		return factorial(n) / (factorial (m)*factorial(n-m));
	}
}
